package com.scujj.cs6.model.vo;

import com.scujj.cs6.model.entity.User;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

@Schema(description = "用户详细信息")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserVo {
    @Schema(description = "用户ID", example = "1")
    private Long id;

    @Schema(description = "用户名", example = "cirno")
    private String username;

    @Schema(description = "邮箱", example = "john.doe@example.com")
    private String email;

    @Schema(description = "手机号", example = "13800138000")
    private String phone;

    @Schema(description = "头像", example = "https://example.com/avatar.jpg")
    private String avatar;

    @Schema(description = "总关注数", example = "10")
    private Integer totalFollows;

    @Schema(description = "总粉丝数", example = "20")
    private Integer totalFans;

    @Schema(description = "总回答数", example = "10")
    private Integer totalAnswers;

    @Schema(description = "总提问数", example = "5")
    private Integer totalQuestions;

    @Schema(description = "总获得点赞数", example = "300")
    private Integer totalGetLikes;

    public UserVo (User user) {
        BeanUtils.copyProperties(user, this);
    }
}
